<!-- File: /app/View/Acounts/assign_pos.ctp -->

<!-- @author Hussein Abo El Seoud -->

<h1>Following you on Twitter: </h1>

<table>
    <!-- Here is where we loop through our $ids array, printing out each follower's info -->
    <?php
    App::import('Model', 'Account');
    $i = 0;
    foreach ($ids as $id):
        $acc = new Account();
        $data = (array) $acc->connectionRequest($accountID)->get('users/show', array('user_id' => $id));
        ?>
        <tr><td><?php echo $data['name']; ?></td>
            <td><?php
    if ($data['following']) {
        echo $this->Html->image('https://si0.twimg.com/images/dev/cms/intents/bird/bird_blue/bird_16_blue.png') . ' ' . $this->Html->link('Unfollow', array('controller' => 'accounts', 'action' => 'unfollow', ($data['screen_name']), 1));
    } else {
        echo $this->Html->image('https://si0.twimg.com/images/dev/cms/intents/bird/bird_blue/bird_16_blue.png') . ' ' . $this->Html->link('Follow', array('controller' => 'accounts', 'action' => 'follow', ($data['screen_name']), 1));
    }
        ?></td></tr>
        <?php
        if (++$i == 10)
            break;
    endforeach;
    ?>
</table>